<?php


namespace app\user\controller;

use app\common\Tools;
use think\Db;

class Home extends LoggingBase
{

    #region 界面
    public function Index(){
        $this->assign('Today',date('Y年m月d日'));
        $this->assign('Weekday',Tools::mb_GetWeekday());

        $Hour = date('H');
        $Welcome = '凌晨好';
        if ($Hour >= 5 && $Hour < 8) {
            $Welcome = '早晨好';
        } else if ($Hour >= 8 && $Hour < 11) {
            $Welcome = '上午好';
        } else if ($Hour >= 11 && $Hour < 13){
            $Welcome = '中午好';
        } else if($Hour >= 13 && $Hour < 16){
            $Welcome = '下午好';
        } else if($Hour >= 16 && $Hour < 19){
            $Welcome = '傍晚好';
        }  else if($Hour >= 19 && $Hour < 24){
            $Welcome = '晚上好';
        }
        $this->assign('Welcome', $Welcome);

        $CompanyID = $this->m_User->CompanyID;
        $CompanyName = Db::table('company')->where("IsDeleted='0' AND ID='$CompanyID'")->find()['Name'];
        $this->assign('CompanyName',$CompanyName);
        $this->assign('UserNick', $this->m_User->Nick);

        return $this->mb_Display('工作概况','Dashboard');
    }
    #endregion

    #region 接口
    #endregion


}